import service from "@/utils/request"

import LoginWork from "@/utils/LoginWork" 

// 剩料资料查询
export interface ResidualMaterialInformationQueryParms{
    slipNo: string,
    slipDate: string,
    sysUser: string
}

export const ResidualMaterialInformationQuery = (slipNo:string,slipDateStart:string,slipDateEnd:string) => {
    return service.post<any,ResidualMaterialInformationQueryParms[]>(`/pcFactorStockQuery/getSurpAccHeadQuery?slipNo=${slipNo}&slipDateStart=${slipDateStart}&slipDateEnd=${slipDateEnd}`)
}

// 转剩料仓明细查询
export interface TurnOverBinDetailQueryParms{
    slipReason: string,
    mtlNo: string,
    mtlColor: string,
    mtlName: string,
    mtlSpec: string,
    mtlUnit: string,
    qty: number,
    remark: null | string
}

export const TurnOverBinDetailQuery = (slipNo:string) => {
    return service.post<any,any>(`/pcFactorStockQuery/getSurpAccDetailQuery?slipNo=${slipNo}`)
}

// 剩料仓材料删除
export const TheRemainingBinMaterialIsDeleted = (slipNo:string,mtlNo:string) => {
    return LoginWork.post<any,any>(`/pcFactorStockQuery/getSurpAccDetail?slipNo=${slipNo}&mtlNo=${mtlNo}`)
}

// 剩料确认作业
export const ResidualMaterialConfirmationOperation = (slipNp:any[],type:number) => {
    return LoginWork.put<any,any>(`/pcFactorStockQuery/getSurpAccUp?&type=${type}`,slipNp)
}